import {post} from "@/api/Http";
import type {AxiosPromise} from "axios";

// 定义参数的接口
export interface RandomCharacterParams {
    length: number;
    chooseNumber?: number;
    chooseLowerLetter?: number;
    chooseUpperLetter?: number;
    chooseSpecial?: number;
    prefix?: string; // 新增：固定前缀
    [key: string]: any; // 允许其他属性
}

/**
 * 随机字符生成器
 * @param param
 * @returns {Promise<AxiosPromise<any>>}
 */
export const generateRandomCharacter = (param: RandomCharacterParams): AxiosPromise<any> => {
    return post('/random/character', param);
} 